<template>
    <p>这是一个子组件</p>
    <p>父组件传下来的值---{{ parentMsg }}</p>
    <button @click="changenParentMsg">将子组件的信息传给父组件</button>
</template>


<script>
export default {
    name: "ChildCom",

    props: {
        parentMsg: ''
    },
    emits:['changeParentInfo'],
    methods: {
        changenParentMsg() {
            console.log(123);
            this.$emit("changeParentInfo", 456)
        }
    }
}
</script>